<style>
    .comment-tipoff {
        cursor: pointer;
    }
</style>
<link href="{{asset('/industry/comment.css')}}" rel="stylesheet">
<script src="{{asset('js/common/comment-m.js')}}"></script>
<div id="cimo_comment">
    <span class="h4 comment-h4">评论</span>
    <div class="progress tiaotiao">
        <div class="progress-bar progress-bar-success " role="progressbar" aria-valuenow="10" aria-valuemin="0" aria-valuemax="100" style="width: 20%;">
            <span class="sr-only"></span>
        </div>
    </div>
    <div class="first-comment-form clearfix">
        <textarea id="comment-reply-content" placeholder="写评论" data-emojiable="true"></textarea>
        <div class="clearfix">
            <div id="message" class="clearfix" style="display: none;"></div>
            <button type="button" class="fr" id="submit-main" @if(empty($authuser))onclick="
            @if(is_mobile())
                    tologin();
            @else
                    loginTips();
            @endif"
                    @endif>
                发送
            </button>
        </div>
    </div>
    <div class="clearfix"></div>
    <div id="cimo-comment-container">
        @foreach($comments as $k=>$vo)
            <div class="cimo-comment-common" id="comment-common{{$k}}" style="">
                <div class="cimo-comment-user-avatar fl ">
                    <a name="{{$vo->comment_id}}" cdata-id="{{$k}}">
                        <img src="{{userlogo($vo->user_id,'middle')}}">
                    </a>
                </div>
                <div class="pull-left cimo-comment-right" style="" data-commentid="{{$vo->comment_id}}">
                    <div class="comment-content text-left" style="">
                        <div class="cimo-comment-first clearfix">
                            <span class="cimo-comment-username">{{getUserName($vo->user_id)}}</span>
                            <span style="float:right;" class="clearfix">
                                <a href="javascript:;" class="comment-response" data-uid="{{$vo->user_id}}"></a>
                                @if(count($vo->childComments)>0)
                                    <span name="totalnum{{$vo->comment_id}}">{{count($vo->childComments)}}</span>
                                @else
                                    <span name="totalnum{{$vo->comment_id}}">0</span>
                                @endif

                                <a class="comment-thumb" data-id="{{$vo->comment_id}}" @if(empty($authuser))onclick="@if(is_mobile())tologin();@else loginTips();@endif"@endif></a><span>{{$vo->thumbs}}</span>
                                <a class="comment-tipoff" data-id="{{$vo->comment_id}}" @if(empty($authuser))onclick="@if(is_mobile())tologin();@else loginTips();@endif"@endif></a>

                            </span>
                        </div>
                        {{--<span class="cimo-comment-time">{{$vo->created_at}}</span>--}}
                        <p class="cimo-comment-second" style=" ">{{$vo->content}}</p>
                    </div>
                    <div class="comment-child text-left" id="comment-childs{{$vo->comment_id}}">
                        @if(count($vo->childComments)>0)
                            <div class="comment-caret-up">
                                <i class="glyphicon glyphicon-triangle-top"></i>
                            </div>
                            <div class="comment-child-content" id="comment-child-content{{$vo->comment_id}}" style="">
                                @foreach($vo->childComments as $key=>$zn)
                                    @if($key<30)
                                        <div class="comment-child-content-list">
                                            <div class="color-green">
                                                <span style="color: #383838;">{{getUserName($zn->user_id)}}</span>
                                                <span style="margin: 0 4px; color:#999;">回复</span>
                                                <span style="color: #383838;">{{getUserName($zn->to_user_id)}}</span>
                                                 <span style="float:right;" class="childrig">
                                                     {{--<a class="comment-tipoff" data-id="{{$zn->comment_id}}">举报</a>--}}
                                                     <a class="comment-thumb" data-id="{{$zn->comment_id}}" @if(empty($authuser))onclick="@if(is_mobile())tologin();@else loginTips();@endif"@endif></a><span>{{ $zn->thumbs or 0 }}</span>

                                                </span>
                                            </div>
                                            {{--<span class="cimo-comment-time">{{$zn->created_at}}</span>--}}
                                            <p class="comment-child-cont">{{$zn->content}}</p>
                                        </div>
                                    @endif
                                @endforeach
                            </div>
                        @endif
                    </div>
                    <div id="message{{$vo->comment_id}}" class="commentmsg dn"></div>
                    <div id="comment-reply{{$vo->comment_id}}" class="comment-reply-form" style=" border: none;">

                    </div>
                </div>
                <div class="clr"></div>
            </div>
        @endforeach
    </div>
    {{-- 分页 --}}
    <div id="holder" @if(count($comments)== 0) class="holder dn" @else class="holder" @endif></div>
    <script>
        cjPages();
    </script>
</div>
{{--回复的回复--}}
<div id="commentform" style="display: none;">
    <span class="toname"></span>
    <div class="comment-reply-form-b clearfix" style="position: relative;">
        <input type="hidden" name="cmtid" value="">
        <input type="hidden" name="to_userid" value="">
        {!! csrf_field() !!}
        <textarea data-emojiable="true" class="comment-reply-content-common"></textarea>
        <button type="button" class="secondsubmit fr" @if(empty($authuser))onclick="loginTips()" @endif>回复</button>
    </div>
</div>
{{--举报--}}
<div class="modal fade" id="examModalcm" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content selExam" style="font-size: 12px;font-family: inherit;">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close" style="margin-top: -12px;">
                    <span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="resumeModalLabel" style="text-align: center;">欢迎举报，请选择举报原因：</h4>
            </div>
            <div class="modal-body">
                <div id="examSelect" style="text-align: center;">
                    <select name="reason" style="width:100px; height:28px;">
                        <option value="2">广告垃圾</option>
                        <option value="1">淫秽色情</option>
                        <option value="3">违法信息</option>
                        <option value="0">其它</option>
                    </select>
                    <input type="hidden" name="tipoffid" value="">
                    <button type="button" class="comment-tipoffs" style="width:100px; height:28px;">确定</button>
                </div>
            </div>
        </div>
    </div>
</div>